#ifndef MAP_HH
# define MAP_HH

#include <boost/shared_ptr.hpp>

# include <GL/glew.h>

# include <math/vector.hh>
# include <map>

//libbooby
# include <tools/list.hh>

# include "../interfaces/displayable.hh"
# include "../display/pos.hh"
# include "../display/texture.hh"

class Map: public Displayable
{
public:
  Map ();
  Map (int size);
  ~Map ();

  virtual void dispatch () const;
  void operator() (Vector3d* p);

  void init_bos ();

  int size () const { return size_; }

  bool built () const { return built_; }
  void built (bool val) { built_ = val; }

protected:
  List<int>*** v_;
  int size_;
  bool built_;

  //display
  GLuint vbo_;
  GLuint ibo_;
  Point* disp_;
  uint* index_;

  boost::shared_ptr<Texture> tex_;

  void init_ibo ();
  void init_vbo ();
};

#endif /// !MAP_HH
